<script setup lang="ts">
import { findBanner } from '@/service/api/home'
import { IBanner } from '@/service/api/type/home.type'
import { reactive } from 'vue'

const sliders: IBanner[] = reactive([])
const getBannerData = async () => {
  const response = await findBanner()
  sliders.push(...response.result)
}

getBannerData()
</script>
<template>
  <div class="home-banner">
    <Carousel :sliders="sliders" :autoPlay="true" v-if="sliders.length" />
  </div>
</template>

<style lang="less" scoped>
.home-banner {
  width: 1240px;
  height: 500px;
  position: absolute;
  left: 0;
  top: 0;
  z-index: 98;
}
.carousel {
  :deep(.carousel-btn.prev) {
    left: 270px;
  }
  :deep(.carousel-indicator) {
    padding-left: 250px;
  }
}
</style>
